<?php /* Template Name: Home */ ?>

<?php get_header(); ?>
<div class="row">
	<div class="col-md-12">
		<?php echo get_page_template_by_lang('home'); ?>
    </div>
</div>

<div class="row">
	<?php
    $isEn = is_en();
    $min_h_class = 'min-h-242';
    $aKeys = new stdClass();
    if($isEn==true){
        $aKeys->desc_header = 'ec_desc_header_en';
        $aKeys->desc_content = 'ec_desc_content_en';
    } else {
        $aKeys->desc_header = 'ec_desc_header_vi';
        $aKeys->desc_content = 'ec_desc_content_vi';
        $min_h_class = 'min-h-198';
    }
	$args = array('post_type'=>'english-course', 'order'=>'ASC');
	query_posts( $args );
	while ( have_posts() ) : the_post();
	?>
	<div class="col-md-6 ec-desc">
		<div class="thumbnail <?php echo $min_h_class; ?>">
			<?php
                $post_meta = get_post_meta(get_the_ID());
                $pTitle = $isEn==true ? get_the_title():$post_meta['ec_title_vi'][0];
            ?>
            <div class="caption">
                <a class="alert alert-info alert-link" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php echo $pTitle; ?></a>
  			</div>
            <div class="thumb-content hyphen">
                <p><strong><?php echo $post_meta[$aKeys->desc_header][0]; ?></strong></p>
				<div><?php echo $post_meta[$aKeys->desc_content][0]; ?></div>
            </div>
		</div>
	</div>
	<?php
	endwhile;
	wp_reset_query();
	?>
</div>

<?php get_footer(); ?>